$(function(){
		$('.sidebar-list').on('click','a',function(){
			var target=$(this).parents('dl');
			var a=$(this);
			var tab = target.attr('data-tab');
			target.addClass('selected').siblings('.selected').toggleClass('selected');
			a.parents('dl').siblings('dl').find('dd').find('a').css("color","#666666");
			a.parents('dd').siblings('dd').find('a').css("color","#666666");
			a.css("color","#e20d00");
			var target=$(".sidebar-list .tab[data-content="+tab+"]");
			if(!target.hasClass('selected')){
				var content = $(".helpcenter_main .content[data-content="+tab+"]");
				var seletedContent = content.siblings('.selected');
				seletedContent.fadeOut(10,function(){
							content.find('div').css('display','block');
							seletedContent.toggleClass('selected');
							content.fadeIn(10,function(){
							content.toggleClass('selected');
							});
				})
			}
		})
		var content=$('.list a');
		content.on('click',function(){
			var div=$(this).siblings('div');
			div.toggle();
		})
		var top=$('.sidebar').offset();//获取位置
		var wai=$('.max').offset();
		
		$(window).scroll(function(){
			var xia=$('.bottom').offset();//获取页脚位置
			var scrollTop = $(this).scrollTop();// 获取滚动条距离顶部的距离
			
			if((scrollTop+top.top+354)>xia.top){
				$('.sidebar').css({
					"position" : "absolute",
					top : xia.top-(top.top+485),
					left: "0px"
				});
				return;
			}
			if(top.top<scrollTop){
				$('.sidebar').css({
					"position" : "fixed",
					top : "0px",
					left: top.left
				})
			}else if(top.top>scrollTop){
				$('.sidebar').css({
					"position" : "absolute",
					top : "0px",
					left:"0px"
				});
			}
			console.log(top.left)
			});
	});